<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<%@page import="avicit.platform6.core.locale.PlatformLocalesJSTL"%>
<%@page import="java.util.Locale"%>
<%@page import="avicit.platform6.api.session.SessionHelper"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ page import="avicit.platform6.commons.utils.ViewUtil"%>
<%@ taglib prefix="sec"
	uri="/WEB-INF/tags/shiro.tld"%>
<%@page import="avicit.platform6.api.sysshirolog.impl.AfterLoginSessionProcess"%>
<% 
Object lang=session.getAttribute(AfterLoginSessionProcess.SESSION_CURRENT_LANGUAGE_CODE);
String languageCode="zh_CN";
if(lang!=null){
	languageCode=lang.toString();
}
	Locale locale =SessionHelper.getLocaleByUser(request);
%>

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>排序设置</title>
<base href="<%=ViewUtil.getRequestPath(request)%>">

<jsp:include
	page="/avicit/platform6/component/common/EasyUIJsInclude.jsp"></jsp:include>
<script type="text/javascript"
	src="avicit/cbb/techclass/tabledefine/commtablemanager/TableColSort.js"></script>
<jsp:include page="/avicit/im/common/ImUIJSCSSInclude.jsp"></jsp:include>
<script type="text/javascript"
	src="avicit/cbb/techclass/tabledefine/commtablemanager/locale/language_<%=languageCode%>.js"></script>
<%
	String sysId = request.getParameter("sysId");
	String tableName = request.getParameter("tableName");
	String nodeTypeNew = request.getParameter("nodeType");
	String nodeId = request.getParameter("nodeId");
	String nodeName = request.getParameter("nodeName");
%>
<link href="static/css/custom/lantop/css/custom.css" type="text/css"  rel="stylesheet">
<script type="text/javascript">
var baseurl = "<%=ViewUtil.getRequestPath(request)%>";
	//此事件必须放在jsp中,不能提取到js中,否则不能加载数据
	$(function() {
		sysId = "<%=sysId%>";
		tableName = "<%=tableName%>";
		nodeTypeNew = "<%=nodeTypeNew%>";
		nodeId = "<%=nodeId%>";
		nodeName = "<%=nodeName%>";
		if ("" == tableName || "null" == tableName) {
			tableName = "CBB_CS_WJ";
		}
		if ("" == nodeTypeNew || "null" == nodeTypeNew) {
			nodeTypeNew = "Y";
		}
		document.getElementById("selectCol").style.display = 'none';
		if (nodeTypeNew == "N") {
			$('#add').linkbutton('disable');
			$('#removeit').linkbutton('disable');
			$('#MoveUp').linkbutton('disable');
			$('#MoveDown').linkbutton('disable');
			$('#save').linkbutton('disable');
		}
		if ("" == sysId || "null" == sysId) {
			sysId = "CBB";
		}
		if ("" == nodeId || "null" == nodeId) {
			nodeId = "-1";
		}
		if ("" == nodeName || "null" == nodeName) {
			nodeName = "测试";
		}
		$('#cbbTabSortDataGrid')
				.datagrid(
						{
							url : 'platform/aos/commtablemanagerController/getCbbTabSortData.json?sysId='
									+ sysId
									+ '&tableName='
									+ tableName
									+ '&isTemplet=' + isTemplet
						});
		$('#cbbTabColSortDataGrid')
				.datagrid(
						{
							url : 'platform/aos/commtablemanagerController/getCbbTabColSortData.json?sysId='
									+ sysId + '&tableName=' + tableName
						});
	});
	
	// SanXiaFiles Create By Tangkun start
	function getResultByInput(){
		$('#cbbTabSortDataGrid').datagrid({
			url : 'platform/aos/commtablemanagerController/getCbbTabSortData.json?sysId=' + sysId + '&tableName=' + tableName + '&isTemplet=' + isTemplet
					+ '&colLabel=colLabel&inputWord=' + encodeURI(encodeURI($('#query').val()))
		});
	}
	function keyDownQuery(){
		if(event.keyCode==13){
			getResultByInput();
		}
	}
	// SanXiaFiles Create By Tangkun End
</script>
<style type="text/css">
.textbox {
	border: solid 1px #a5acb5;
}

.input,img {
	vertical-align: middle;
}

<!--
实现input和img水平对齐 -->.labelbg {
	background:
		url('../../js/jQuery/jquery-easyui-1.3.5/themes/icons/required.gif')
		right 0 no-repeat;
}
.icon-im-newndisallfield{
   margin-top:0px !important;
}
</style>
</head>
<body id="myBody" class="easyui-layout">
	<div data-options="region:'west'"
		style="width: 500px; height: 0; overflow: hidden; font-size: 0;border-right:1px solid #dedede;"
		id="westDiv">
		<div id="tb1"  style="padding: 10px 5px;">
			<sec:accesscontrollist hasPermission="3"
				domainObject="commtablemanager_table_node_record_button_selectAllCol">
				<%-- 显示全部字段 --%>
				<a class="easyui-linkbutton selbtnc" iconCls="icon-im-newndisallfield"   style="margin-left: 20px;"
					onclick="selectAllCol();" href="javascript:void(0);"
					id="selectAllCol"><%=PlatformLocalesJSTL.getBundleValue("lantop.basicdatamanager.libstructuredefine.sortSet.table.button.showAllField","i18n.lantop",locale)%></a>
				<%-- 显示基本字段 --%>
				<a sclass="easyui-linkbutton selbtnc" iconCls="icon-im-newnhideallfield"
					onclick="selectAllCol();" href="javascript:void(0);" id="selectCol"><%=PlatformLocalesJSTL.getBundleValue("lantop.basicdatamanager.libstructuredefine.sortSet.table.button.showAllField.button.showBasicField","i18n.lantop",locale)%></a>
			</sec:accesscontrollist>
			<!--   
				SanXiaFiles Create By Tangkun End 
				-->
				<div style="background: white; width: 150px; height: 25px;border-radius: 3px; border: 1px solid #ccc; float: right;">
					<input placeholder="快速检索" type="text" id="query" onblur="getResultByInput()" onkeydown="keyDownQuery()"
						style="float: left; box-sizing: border-box; padding-left: 5px; width: 123px; height: 25px; outline: none; border: none;" />
					<img src="avicit/im/lantop/common/search/image/icon_tool14.png"
						style="float: right; margin-top: 2px; margin-right: 2px;cursor: pointer;">
				</div>
				<!-- 
				 SanXiaFiles Create By Tangkun End  
			-->
		</div>
		<table id="cbbTabSortDataGrid" data-options="
											rownumbers: false,
											animate: true,
											collapsible: false,
											fitColumns: true,
											autoRowHeight: false,
											singleSelect: true,
											pagination:true,
											pageSize:100, 
											scrollbarSize:0,
											pageList:[100,150,200], 
								    		striped:true,
											fit:true,
											method: 'post',
											toolbar: '#tb1'
										">
			<thead>
				<tr>
					<sec:accesscontrollist hasPermission="3"
						domainObject="commtablemanager_TableColSort_cbbTabSortDataGrid_TABLE_ID">
						<th data-options="field:'TABLE_ID', halign:'center',hidden:true"
							title="主表ID" width="20">主表ID</th>
					</sec:accesscontrollist>
					<sec:accesscontrollist hasPermission="3"
						domainObject="commtablemanager_TableColSort_cbbTabSortDataGrid_COL_ID">
						<th data-options="field:'COL_ID', halign:'center',hidden:true"
							title="列ID" width="20">列ID</th>
					</sec:accesscontrollist>
					<sec:accesscontrollist hasPermission="3"
						domainObject="commtablemanager_TableColSort_cbbTabSortDataGrid_COL_ORDER">
						<%-- 顺序 --%>
						<th
							data-options="field:'COL_ORDER', halign:'center', align:'center',formatter:fomaterColOrder"
							width="50" title="顺序"><%=PlatformLocalesJSTL.getBundleValue("lantop.basicdatamanager.libstructuredefine.sortSet.table.order","i18n.lantop",locale)%></th>
					</sec:accesscontrollist>
					<sec:accesscontrollist hasPermission="3"
						domainObject="commtablemanager_TableColSort_cbbTabSortDataGrid_COL_LABEL">
						<%-- 字段中文名 --%>
						<th
							data-options="field:'COL_LABEL',halign:'center', align:'center',formatter:fomaterColLabel"
							width="100" title="字段英文名"><%=PlatformLocalesJSTL.getBundleValue("lantop.basicdatamanager.libstructuredefine.sortSet.table.fieldCHNName","i18n.lantop",locale)%></th>
					</sec:accesscontrollist>
					<sec:accesscontrollist hasPermission="3"
						domainObject="commtablemanager_TableColSort_cbbTabSortDataGrid_SORT_CODE">
						<%-- 升降序 --%>
						<th
							data-options="field:'SORT_CODE', halign:'center', align:'center',formatter:fomaterType1"
							width="100" title="升降序"><%=PlatformLocalesJSTL.getBundleValue("lantop.basicdatamanager.libstructuredefine.sortSet.table.moveUpDown","i18n.lantop",locale)%></th>
					</sec:accesscontrollist>
					<sec:accesscontrollist hasPermission="3"
						domainObject="commtablemanager_TableColSort_cbbTabSortDataGrid_SORT_ORDER">
						<%-- 排序顺序 --%>
						<th
							data-options="field:'SORT_ORDER', halign:'center', align:'center',formatter:fomaterSortOrder"
							width="100" title="排序顺序"><%=PlatformLocalesJSTL.getBundleValue("lantop.basicdatamanager.libstructuredefine.sortSet.table.sortOrder","i18n.lantop",locale)%></th>
					</sec:accesscontrollist>
					<sec:accesscontrollist hasPermission="3"
						domainObject="commtablemanager_table_structure_datagrid_COL_IS_DISPLAY">
						<th
							data-options="field:'COL_IS_DISPLAY',hidden: true"
							width="100" title="是否显示">是否显示  </th>
					</sec:accesscontrollist>
					<sec:accesscontrollist hasPermission="3"
						domainObject="commtablemanager_table_structure_datagrid_COL_IS_SYS">
						<th
							data-options="field:'COL_IS_SYS',hidden: true"
							width="100" title="系统字段">系统字段</th>
					</sec:accesscontrollist>
				</tr>
			</thead>
		</table>
	</div>
	<div data-options="region:'center'"
		style="height: 0; overflow: hidden; font-size: 0;">
		<div id="tb"  style="padding: 10px 5px;">
			<sec:accesscontrollist hasPermission="3"
				domainObject="commtablemanager_TableColSort_button_append">
				<%-- 添加 --%>
				<a class="easyui-linkbutton selbtnc" iconCls="icon-im-add"  style="margin-left: 38px;"
					onclick="append();" href="javascript:void(0);" id="add"><%=PlatformLocalesJSTL.getBundleValue("lantop.basicdatamanager.libstructuredefine.sortSet.table2.button.add","i18n.lantop",locale)%></a>
			</sec:accesscontrollist>
			<sec:accesscontrollist hasPermission="3"
				domainObject="commtablemanager_TableColSort_button_removeit">
				<%-- 删除 --%>
				<a class="easyui-linkbutton selbtnc" iconCls="icon-im-remove"
					onclick="removeit();" href="javascript:void(0);" id="removeit"><%=PlatformLocalesJSTL.getBundleValue("lantop.basicdatamanager.libstructuredefine.sortSet.table2.button.delete","i18n.lantop",locale)%></a>
			</sec:accesscontrollist>
			<sec:accesscontrollist hasPermission="3"
				domainObject="commtablemanager_TableColSort_button_MoveUp">
				<%-- 上移 --%>
				<a class="easyui-linkbutton selbtnc" iconCls="icon-im-newup"
					onclick="MoveUp();" href="javascript:void(0);" id="MoveUp"><%=PlatformLocalesJSTL.getBundleValue("lantop.basicdatamanager.libstructuredefine.sortSet.table2.button.moveUp","i18n.lantop",locale)%></a>
			</sec:accesscontrollist>
			<sec:accesscontrollist hasPermission="3"
				domainObject="commtablemanager_TableColSort_button_MoveDown">
				<%-- 下移 --%>
				<a class="easyui-linkbutton selbtnc" iconCls="icon-im-newdown"
					onclick="MoveDown();" href="javascript:void(0);" id="MoveDown"><%=PlatformLocalesJSTL.getBundleValue("lantop.basicdatamanager.libstructuredefine.sortSet.table2.button.moveDown","i18n.lantop",locale)%></a>
			</sec:accesscontrollist>
			<sec:accesscontrollist hasPermission="3"
				domainObject="commtablemanager_TableColSort_button_accept">
				<%-- 保存 --%>
				<a class="easyui-linkbutton selbtnc" iconCls="icon-im-save"
					onclick="accept();" href="javascript:void(0);" id="save"><%=PlatformLocalesJSTL.getBundleValue("lantop.basicdatamanager.libstructuredefine.sortSet.table2.button.save","i18n.lantop",locale)%></a>
			</sec:accesscontrollist>
		</div>
		<table id="cbbTabColSortDataGrid" data-options="
											rownumbers: true,
											animate: true,
											collapsible: false,
											fitColumns: true,
											autoRowHeight: false,
											singleSelect: true,
											pagination:true,
											pageSize:100, 
											pageList:[100,150,200], 
								    		striped:true,
								    		scrollbarSize:0,
											fit:true,
											method: 'post',
											onClickRow:onClickRowCode,
											sortOrder: 'asc',
											selectOnCheck:false,
											toolbar: '#tb'
										">
			<thead>
				<tr>
					<sec:accesscontrollist hasPermission="3"
						domainObject="commtablemanager_TableColSort_cbbTabColSortDataGrid_ID">
						<th data-options="field:'ID', halign:'center',checkbox:true"
							title="主键ID" width="20">主键ID</th>
					</sec:accesscontrollist>
					<sec:accesscontrollist hasPermission="3"
						domainObject="commtablemanager_TableColSort_cbbTabColSortDataGrid_TABLE_ID">
						<th data-options="field:'TABLE_ID', halign:'center',hidden:true"
							title="表ID" width="20">表ID</th>
					</sec:accesscontrollist>
					<sec:accesscontrollist hasPermission="3"
						domainObject="commtablemanager_TableColSort_cbbTabColSortDataGrid_COLUMN_ID">
						<th data-options="field:'COLUMN_ID', halign:'center',hidden:true"
							title="列ID" width="20">列ID</th>
					</sec:accesscontrollist>
					<sec:accesscontrollist hasPermission="3"
						domainObject="commtablemanager_TableColSort_cbbTabColSortDataGrid_SORT_ORDER">
						<%-- 顺序 --%>
						<th
							data-options="field:'SORT_ORDER', halign:'center',align:'center', editor:{type:'numberbox',options:{required:true,'validType':'length[0,10]'}}"
							width="100" title="顺序"><img
							src="avicit/im/common/im_themes_extend/required.gif" alt="必填">
							<%=PlatformLocalesJSTL.getBundleValue("lantop.basicdatamanager.libstructuredefine.sortSet.table2.order","i18n.lantop",locale)%></th>
					</sec:accesscontrollist>
					<sec:accesscontrollist hasPermission="3"
						domainObject="commtablemanager_TableColSort_cbbTabColSortDataGrid_COL_LABEL">
						<%-- 字段名称 --%>
						<th
							data-options="field:'COL_LABEL',halign:'center', align:'center'"
							width="100" title="字段名称"><img
							src="avicit/im/common/im_themes_extend/required.gif" alt="必填">
							<%=PlatformLocalesJSTL.getBundleValue("lantop.basicdatamanager.libstructuredefine.sortSet.table2.fieldName","i18n.lantop",locale)%></th>
					</sec:accesscontrollist>
					<sec:accesscontrollist hasPermission="3"
						domainObject="commtablemanager_TableColSort_cbbTabColSortDataGrid_SORT_CODE">
						<%-- 升降序 --%>
						<th
							data-options="field:'SORT_CODE',halign:'center', align:'center',editor:{type:'combobox',options:{required:true,panelHeight: 'auto',valueField:'lookupCode',textField:'lookupName',data:[{lookupCode:'A',lookupName:'升序'},{lookupCode:'D',lookupName:'降序'}],editable:false}},formatter:fomaterType2"
							width="100" title="升降序"><img
							src="avicit/im/common/im_themes_extend/required.gif" alt="必填">
							<%=PlatformLocalesJSTL.getBundleValue("lantop.basicdatamanager.libstructuredefine.sortSet.table2.moveUpDown","i18n.lantop",locale)%></th>
					</sec:accesscontrollist>
				</tr>
			</thead>
		</table>
	</div>
</body>
<script type="text/javascript" src="static/js/platform/index/js/divscroll.js" ></script>
<script>
	$(function(){
		$(".datagrid-view2").find(".datagrid-body").perfectScrollbar();
	});
</script>
</html>
